<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<title>Evaluating expressions</title>
</head>
<body>
<h1> Evaluating expressions </h1>
<p>When the VM suspends a thread (due to hitting a breakpoint or stepping through 
  code), you can evaluate expressions in the context of a stack frame. </p>
<ol>
  <li> Select the stack frame in which an evaluation is to be performed. The evaluation context will be the currently selected variable in the view. If no variable 
    is selected, the selected stack frame will be the context. </li>
  <li> Expressions can be entered and evaluated in the following areas:
    <ul>
      <li> <strong><a href="../reference/views/display/ref-debug_shell_view.htm">Debug Shell View</a></strong> </li>
      <li> <a href="../reference/views/shared/ref-detailpane.htm"><strong>Detail Pane</strong></a> (in the <a href="../reference/views/expressions/ref-expressions_view.htm"><strong>Expressions View</strong></a> and <a href="../reference/views/variables/ref-variables_view.htm"><strong>Variables View</strong></a>)</li>
      <li><a href="../concepts/concept-java-editor.htm"><strong>Java Editor</strong></a> when it is displaying source and it is not read-only </li>
    </ul>
  </li>
  <li> Select the expression to be evaluated and select <a href="../reference/views/shared/ref-display.htm"><strong>Display</strong></a>, <a href="../reference/views/shared/ref-inspect.htm"><strong>Inspect</strong></a> or <a href="../reference/views/shared/ref-execute.htm"><strong>Execute</strong></a> from the context pop-up 
    menu. The result of a <strong>Display</strong> or <strong>Inspect </strong>evaluation 
    is shown in a popup window. Note that <strong>Execute</strong> does not display 
    a result - the expression is just executed.</li>
  <li>The result popup window can be dismissed by clicking outside of the popup 
    window or by pressing <em><strong>Esc</strong></em>. The result can be persisted to 
    the Debug Shell view (if <strong>Display</strong> was chosen) or Expressions view 
    (if <strong>Inspect</strong> was chosen) by pressing the key sequence shown 
    at the bottom of the popup window. For example, to move the result of an <strong>Inspect </strong>evaluation to the Expressions view press <em><strong>Ctrl-Shift-I</strong></em>. 
    Note that when the <strong>Display</strong> action is used from the Display 
    view the result is written to the Debug Shell view rather than a popup</li>
</ol>
<p><strong>Note:</strong> Evaluations cannot be performed in threads that have been manually suspended.</p>
<h3 class="related">Related concepts</h3>
  <a href="../concepts/cdebugger.htm">Debugger</a><br>
  <a href="../concepts/concept-java-editor.htm">Java editor</a>
<h3 class="related">Related tasks</h3>
  <a href="../tasks/task-suspending_threads.htm">Suspending threads</a><br>
  <a href="../tasks/task-resuming_threads.htm">Resuming the execution of suspended threads</a>
<h3 class="related">Related references</h3>
  <a href="../reference/views/shared/ref-detailpane.htm">Detail Pane</a><br>
  <a href="../reference/views/display/ref-debug_shell_view.htm">Debug Shell view</a><br>
  <a href="../reference/views/expressions/ref-expressions_view.htm">Expressions view</a><br>
  <a href="../reference/views/variables/ref-variables_view.htm">Variables view</a>
</body>
</html>